<?php

/* Author: Panos Sakkos
 * Deletes the entities with the ids given. Checks if the user which tries
 * to delete the entities is the category's owner.
 */

function BL_delete_entities($categoryId, $entityIds, $userId)
{
	$category = DB_getCategory($categoryId);
    
	if($userId == $category->GetOwner())	//cross exam if the user that wants to delete the category is it's owners
	{
		$i = 0;

		for($i = 0; $i < count($entityIds); $i++)
		{
			BL_delete_entity($categoryId, $entityIds[$i], $userId);
		}

		return BL_OK;
	}
	else
	{
		return BL_NOT_OWNER;
	}
}

?>